spinbutton: Fold function into only caller
authorTimm Bäder <mail@baedert.org>
Mon, 26 Feb 2018 19:23:45 +0000 (20:23 +0100)
committerTimm Bäder <mail@baedert.org>
Tue, 27 Feb 2018 09:30:14 +0000 (10:30 +0100)
gtk/gtkspinbutton.c

index 58d05878222f1b22dffbe7380bcab8301be1ff9d..c7ee077c04a1c09f7fbd86136d73e768b138a687 100644 (file)
@@ -720,28 +720,6 @@ scroll_controller_scroll (GtkEventControllerScroll *Scroll,
   gtk_spin_button_real_spin (spin, -dy * gtk_adjustment_get_step_increment (priv->adjustment));
 }
 
-static void
-update_node_ordering (GtkSpinButton *spin_button)
-{
-  GtkSpinButtonPrivate *priv = spin_button->priv;
-
-  g_assert (priv->orientation != gtk_orientable_get_orientation (GTK_ORIENTABLE (priv->box)));
-
-  if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
-    {
-      /* Current orientation of the box is vertical! */
-      gtk_box_reorder_child (GTK_BOX (priv->box), priv->entry, 0);
-      gtk_box_reorder_child (GTK_BOX (priv->box), priv->down_button, 1);
-    }
-  else
-    {
-      /* Current orientation of the box is horizontal! */
-      gtk_box_reorder_child (GTK_BOX (priv->box), priv->up_button, 0);
-    }
-
-  gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->box), priv->orientation);
-}
-
 static gboolean
 gtk_spin_button_stop_spinning (GtkSpinButton *spin)
 {
@@ -1032,10 +1010,21 @@ gtk_spin_button_set_orientation (GtkSpinButton  *spin,
            gtk_entry_get_alignment (entry) == 0.5)
     gtk_entry_set_alignment (entry, 0.0);
 
-  update_node_ordering (spin);
+  if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+    {
+      /* Current orientation of the box is vertical! */
+      gtk_box_reorder_child (GTK_BOX (priv->box), priv->entry, 0);
+      gtk_box_reorder_child (GTK_BOX (priv->box), priv->down_button, 1);
+    }
+  else
+    {
+      /* Current orientation of the box is horizontal! */
+      gtk_box_reorder_child (GTK_BOX (priv->box), priv->up_button, 0);
+    }
+
+  gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->box), priv->orientation);
 
   g_object_notify (G_OBJECT (spin), "orientation");
-  gtk_widget_queue_resize (GTK_WIDGET (spin));
 }
 
 static gchar *